package com.haver.service.impl;

import com.haver.dao.SingleDao;
import com.haver.entity.SingleEntity;
import com.haver.service.SingleService;
import com.haver.utils.DaoFactory;


import javax.servlet.annotation.WebServlet;

import java.io.BufferedReader;
import java.util.List;

@WebServlet
public class SingleServiceImpl implements SingleService {
    private SingleDao singleDao;
    {
        DaoFactory<SingleDao> singleDaoDaoFactory = new DaoFactory();
        singleDao =singleDaoDaoFactory.getDaoTransaction(SingleDao.class);
    }

    /**
     *
     * @param role
     * @return
     */


    @Override
    public Integer addRole(String role) {
        return singleDao.addRole(role);
    }

    @Override
    public Integer removeById(Integer id) {
        return singleDao.removeById(id);
    }

    @Override
    public Integer updateById(Integer id,String name) {
        return singleDao.updateById(id,name);
    }

    @Override
    public List<SingleEntity> checkAll() {
        return singleDao.checkAll();
    }

    @Override
    public Integer checkIdByName(String name) {





        return singleDao.checkIdByName(name);
    }
}
